/**
*****************************************************************************
 * @file 
 * @brief 任务管理
 * @author luffy
 * @version V1.0.0
 * @date 2022/12/16
****************************************************************************
 */
/* Includes ---------------------------------------------------------------*/
#include "FreeRTOS.h"
#include "task.h"
#include "led_task.h"
#include "lncup_ctl_task.h"
#include "valve_ctl_task.h"
#include "monitor_task.h"
#include "main_task.h"
#include "calibrate_dac_task.h"
#include "backfill_task.h"
#include "detect_press_task.h"
#include "lwip_app.h"
#include "A_shell.h"

/* Private defines ---------------------------------------------------------------*/
/* Private Struct ---------------------------------------------------------------*/
/* Private enum ---------------------------------------------------------------*/
/* Private Variable ---------------------------------------------------------------*/
//Pointer
//Array
//Const
/* Private function prototypes -----------------------------------------------*/

#define LED_TASK_PRIO      4        //任务优先级
#define LED_STK_SIZE       256      //任务堆栈大小

#define LNCUP_TASK_PRIO    2        //任务优先级
#define LNCUP_STK_SIZE     128      //任务堆栈大小

#define VALVE_TASK_PRIO    2        //任务优先级
#define VALVE_STK_SIZE     128      //任务堆栈大小

#define MONITOR_TASK_PRIO  6        //任务优先级
#define MONITOR_STK_SIZE   1024      //任务堆栈大小

#define COM_TASK_PRIO      7        //任务优先级
#define COM_STK_SIZE       1024      //任务堆栈大小

#define MAIN_TASK_PRIO      6        //任务优先级
#define MAIN_STK_SIZE       1024      //任务堆栈大小

#define CLAIPROVALVE_TASK_PRIO      5        //任务优先级
#define CLAIPROVALVE_STK_SIZE       1024      //任务堆栈大小


#define BACKFILL_TASK_PRIO      4        //任务优先级
#define BACKFILL_STK_SIZE       512      //任务堆栈大小


TaskHandle_t ComTask_Handler;                  //任务句柄
TaskHandle_t LedTask_Handler;                  //任务句柄
TaskHandle_t LncupTask_Handler;                //任务句柄
TaskHandle_t ValveTask_Handler;                //任务句柄
//TaskHandle_t MonitorTask_Handler;              //任务句柄
TaskHandle_t MonitorDataCollectionTask_Handler = NULL;  //任务句柄
TaskHandle_t MonitorDataUploadTask_Handler = NULL;			 //任务句柄
TaskHandle_t PFCTask_Handler;                  //任务句柄
TaskHandle_t MainTask_Handler;                 //任务句柄
TaskHandle_t CaliProvaleTask_Handler;          //任务句柄
TaskHandle_t Backfill_Handler;  
/*****************************************************************************
* @brief 
* ex:
* @par 
* None
* @retval 
*****************************************************************************/
void task_mng_init(void)
{
	xTaskCreate(LedTaskProcess, "LedTask",
			LED_STK_SIZE,
			NULL,
			LED_TASK_PRIO,
			&LedTask_Handler);

	xTaskCreate(MainTask, "MainTask",
			MAIN_STK_SIZE,
			NULL,
			MAIN_TASK_PRIO,
			&MainTask_Handler);

	xTaskCreate(eth_loopback_task, "ComTask",
			COM_STK_SIZE,
			NULL,
			COM_TASK_PRIO,
			&ComTask_Handler);

//	xTaskCreate(MonitorTask, "MonitorTask",
//			MONITOR_STK_SIZE,
//			NULL,
//			MONITOR_TASK_PRIO,
//			&MonitorTask_Handler);
                
    xTaskCreate(MonitorDataUploadTask, "MonitorUplaodTask",
                MONITOR_STK_SIZE,
                NULL,
                MONITOR_TASK_PRIO,
                &MonitorDataUploadTask_Handler);	
    xTaskCreate(MonitorDataCollectTask, "MonitorCollectTask",
                MONITOR_STK_SIZE,
                NULL,
                MONITOR_TASK_PRIO,
                &MonitorDataCollectionTask_Handler);


	xTaskCreate(CaliProvalveTask, "CaliProvalveTask",
			CLAIPROVALVE_STK_SIZE,
			NULL,
			CLAIPROVALVE_TASK_PRIO,
			&CaliProvaleTask_Handler);
			
	xTaskCreate(Backfill_Task, "BackfillTask",
			BACKFILL_STK_SIZE,
			NULL,
			BACKFILL_TASK_PRIO,
			&Backfill_Handler);			
}

/******************* (C) COPYRIGHT 2022 CIQTEK luffy *****END OF FILE****/
